﻿//-----------------------------------------------------------------------
// <copyright file="TokenBasedViewEngine.cs" company="OverrideThis">
//     Copyright (c) 2010 OverrideThis.com
// </copyright>
//-----------------------------------------------------------------------
namespace OverrideThis.ContactManager.WebSite.Infrastructure.ViewEngines
{
    using System;
    using System.Web.Mvc;

    public class TokenBasedViewEngine : VirtualPathProviderViewEngine
    {
        public TokenBasedViewEngine()
        {

            base.ViewLocationFormats = new string[] { "~/Views/{1}/{0}.token" };
            base.PartialViewLocationFormats = base.ViewLocationFormats;
        }

        #region Overrides of VirtualPathProviderViewEngine

        protected override IView CreatePartialView(ControllerContext controllerContext, string partialPath)
        {
            return new TokenBasedView(partialPath);
        }

        protected override IView CreateView(ControllerContext controllerContext, string viewPath, string masterPath)
        {
            return new TokenBasedView(viewPath);
        }


        #endregion
    }
}